package com.dongdong.controller;


import cn.hutool.core.util.StrUtil;
import com.dongdong.service.UserService;
import com.dongdong.utils.Result;
import com.dongdong.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/register")
    public Result register(@RequestBody UserVO user) {

        return userService.register(user);
    }


    @PostMapping("/login")
    public Result login(@RequestParam String username,@RequestParam String password){
        return  userService.login(username,password);
    }

}
